diff -up xmoto-0.5.10/configure.in.lua52 xmoto-0.5.10/configure.in
--- xmoto-0.5.10/configure.in.lua52	2012-05-02 18:08:40.000000000 -0300
+++ xmoto-0.5.10/configure.in	2013-06-22 19:03:13.930669408 -0300
@@ -171,6 +171,7 @@ AC_CHECK_HEADER(lua/lua.h,    AC_DEFINE(
 AC_CHECK_HEADER(lua50/lua.h,  AC_DEFINE(HAVE_LUA50_LUA_H) [USE_LUA_VERSION="5.0"])
 AC_CHECK_HEADER(lua51/lua.h,  AC_DEFINE(HAVE_LUA51_LUA_H) [USE_LUA_VERSION="5.1"])
 AC_CHECK_HEADER(lua5.1/lua.h, AC_DEFINE(HAVE_LUA5_1_LUA_H)[USE_LUA_VERSION="5.1"])
+AC_CHECK_HEADER(lua5.2/lua.h, AC_DEFINE(HAVE_LUA5_2_LUA_H)[USE_LUA_VERSION="5.2"])
 AC_DEFINE(LUA_COMPAT_MODULE, 1)
 
 AC_LANG_PUSH([C++])
diff -up xmoto-0.5.10/src/include/xm_lua.h.lua52 xmoto-0.5.10/src/include/xm_lua.h
--- xmoto-0.5.10/src/include/xm_lua.h.lua52	2013-06-22 19:08:07.873274342 -0300
+++ xmoto-0.5.10/src/include/xm_lua.h	2013-06-22 19:08:43.074802543 -0300
@@ -4,7 +4,11 @@ extern "C" {
     #include "lauxlib.h"
     #include "lualib.h"
   #else
-    #if defined(HAVE_LUA5_1_LUA_H)
+    #if defined(HAVE_LUA5_2_LUA_H)
+      #include <lua5.2/lua.h>
+      #include <lua5.2/lauxlib.h>
+      #include <lua5.2/lualib.h>
+    #elif defined(HAVE_LUA5_1_LUA_H)
       #include <lua5.1/lua.h>
       #include <lua5.1/lauxlib.h>
       #include <lua5.1/lualib.h>
